package cn.itsource.pethome.org.controller;


import cn.itsource.pethome.base.util.JsonResult;
import cn.itsource.pethome.org.domain.Shop;
import cn.itsource.pethome.org.service.IShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/shop")
public class ShopController {
    @Autowired
    private IShopService shopService;

    /**
     * 商家注册之后传递参数
     * 添加对象
     */
    @PostMapping("/settledIn")
    public JsonResult settledIn(@RequestBody Shop shop){
        try {
            shopService.settledIn(shop);
            return new JsonResult();
        } catch (Exception e) {
            e.printStackTrace();
            return new JsonResult(false,"注册失败，请你稍后再试。。。。。");
        }
    }
}
